package exp1.test4;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by 春旺 on 2017/9/25.
 */
public class LinkedTest {
    Linked list = new Linked();
    @Test
    public void add() throws Exception {
        assertEquals(false,list.contains(1));
        list.add(1);
        assertEquals(true,list.contains(1));

    }

    @Test
    public void remove() throws Exception {
        list.add(1);
        list.add(2);
        assertEquals(true,list.contains(1));
        assertEquals(true,list.contains(2));
        list.remove(2);
        assertEquals(false,list.contains(2));
        list.remove(1);
        assertEquals(false,list.contains(1));
    }

    @Test
    public void contains() throws Exception {
        assertEquals(false,list.contains("20162324"));
        list.add("20162324");
        list.add("春旺");
        assertEquals(true,list.contains("春旺"));
        assertEquals(false,list.contains("道巴"));

    }

}